package com.rois.librois.libRoISComponentServer;

import com.rois.librois.RoIS.Argument;
import com.rois.librois.RoIS.ComponentProfileHolder;
import com.rois.librois.RoIS.Parameter;
import com.rois.librois.RoIS.ParameterListHolder;
import com.rois.librois.RoIS.ResultListHolder;
import com.rois.librois.RoIS.ReturnCode_t;

/**
 * Interface for HRI Component function.
 * This interface wraps CORBA server interfaces for HRI Engine to avoid using internal parameters.
 *
 * @author Miki Sato <miki.sato.1225@gmail.com>
 *
 *    The MIT licence
 *
 *    Copyright (C) 2011
 *      ATR Intelligent Robotics and Communication Laboratories, Japan
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a copy
 *    of this software and associated documentation files (the "Software"), to deal
 *    in the Software without restriction, including without limitation the rights
 *    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
 *    of the Software, and to permit persons to whom the Software is furnished to do so,
 *    subject to the following conditions:
 *
 *    The above copyright notice and this permission notice shall be included in all
 *    copies or substantial portions of the Software.
 *
 *    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
 *    INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 *    PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *    HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 *    OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 *    SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

public interface ComponentInterface {
	/////////////////////////////////////////////////////////
	// System Interface
	/////////////////////////////////////////////////////////
	ReturnCode_t get_profile(
		String condition,
		ComponentProfileHolder profile
	);
	ReturnCode_t get_error_detail(
		String error_id,
		String condition,
		ResultListHolder results
	);

	/////////////////////////////////////////////////////////
	// Command Interface
	/////////////////////////////////////////////////////////
	ReturnCode_t bind(
		String servername
	);
	ReturnCode_t release(
		String servername
	);
	ReturnCode_t get_parameter(
		ParameterListHolder parameters
	);
	ReturnCode_t set_parameter(
		String servername,
		Parameter[] parameters,
		org.omg.CORBA.StringHolder command_id
	);
	ReturnCode_t execute(
		String servername,
		String command_type,
		Argument[] arguments,
		org.omg.CORBA.StringHolder command_id
	);
	ReturnCode_t get_command_result(
		String servername,
		String command_id,
		String condition,
		ResultListHolder results
	);

	/////////////////////////////////////////////////////////
	// Query Interface
	/////////////////////////////////////////////////////////
	ReturnCode_t query(
		String query_type,
		String condition,
		ResultListHolder results
	);

	/////////////////////////////////////////////////////////
	// Event Interface
	/////////////////////////////////////////////////////////
	ReturnCode_t subscribe(
		String servername,
		String event_type,
		String condition,
		org.omg.CORBA.StringHolder subscribe_id
	);
	ReturnCode_t unsubscribe(
		String servername,
		String subscribe_id
	);
	ReturnCode_t get_event_detail(
		String servername,
		String event_id,
		String condition,
		ResultListHolder results
	);
}
